<?php
/* @var $this UnidadeController */
/* @var $model Unidade */
/* @var $form CActiveForm */
?>

<div class="form">

<?php $form=$this->beginWidget('CActiveForm', array(
	'id'=>'unidade-form',
	// Please note: When you enable ajax validation, make sure the corresponding
	// controller action is handling ajax validation correctly.
	// There is a call to performAjaxValidation() commented in generated controller code.
	// See class documentation of CActiveForm for details on this.
	'enableAjaxValidation'=>false,
)); ?>

	<p class="note">Campos marcados com <span class="required">*</span> são obrigatórios.</p>

	<?php echo $form->errorSummary($model); ?>

	<div class="row">
		<?php echo $form->labelEx($model,'SiglaUnidade'); ?>
		<?php echo $form->textField($model,'SiglaUnidade',array('size'=>50,'maxlength'=>50)); ?>
		<?php echo $form->error($model,'SiglaUnidade'); ?>
	</div>

	<div class="row">
		<?php echo $form->labelEx($model,'DescrUnidade'); ?>
		<?php echo $form->textField($model,'DescrUnidade',array('size'=>50,'maxlength'=>50)); ?>
		<?php echo $form->error($model,'DescrUnidade'); ?>
		<?php 
                       //echo $form->textField($model,'idProjeto',array('value'=> Projeto::model()->projetoText($model->idProjeto),'readonly' => true)); 
                        //echo $form->dropDownList($model,'idProjeto', Projeto::model() ->getTypeOptions()); 
                        $model->idProjeto=Yii::app()->user->pidproj;       
                        echo $form->hiddenField($model,'idProjeto'); 
                       ?>
		<?php echo $form->error($model,'idProjeto'); ?>
	</div>

	<div class="row buttons">
		<?php echo CHtml::submitButton($model->isNewRecord ? 'Salvar' : 'Salvar'); ?>
	</div>

<?php $this->endWidget(); ?>

</div><!-- form -->